package com.example.mobwe_project;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;

public class SplashActivity extends Activity {
	final static int SPLASH_DISPLAY_LENGTH=3000;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		Handler handler = new Handler();
		handler.postDelayed(getRunnableStartApp(), SPLASH_DISPLAY_LENGTH);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_splash, menu);
		return true;
	}

	private Runnable getRunnableStartApp(){
		Runnable runnable = new Runnable(){
		public void run(){
		Intent intent = new Intent(SplashActivity.this, MenuActivity.class);
		startActivity(intent);
		finish();
		}
		};
		return runnable;
		}
}
